"use strict";function initSummaryButtons(a){function b(a){"string"!=typeof a&&(a=this.title),"undefined"==typeof summaryItemsSeparator&&(window.summaryItemsSeparator=",");let b=e.val(),c=new RegExp("(^|[,;.?!/]) ?"+mw.RegExp.escape(a));c.test(b)||(/[^,; \/]$/.test(b)&&(b+=summaryItemsSeparator),/[^ ]$/.test(b)&&(b+=" "),e.val(b+a).focus().change())}a=a||"classic","undefined"==typeof summaryButtons&&(window.summaryButtons={hideDefaultButtons:!1});let c,d,e;"classic"===a?(d=$("#wpSummaryWidget"),e=$("#wpSummary")):(c=ve.init.target.saveDialog,d=c.editSummaryInput.$element,e=c.editSummaryInput.$input);let f=$("<div>").addClass("summaryButtons").insertAfter(d),g=$("<div>").addClass("summaryButtons-groups").appendTo(f);window.addSumButton=window.addSummaryButton=function(a,c,d){d=d||"custom";let e=$(".summaryButtons-group-"+d);e.length||(e=$("<div>").addClass("mw-ui-button-group summaryButtons-group summaryButtons-group-"+d).appendTo(g)),$("<a>").attr("role","button").attr("title",c).addClass("mw-ui-button summaryButtons-button").html(a).click(b).appendTo(e)};let h="visual"===a?["\u0432\u0438\u043A\u0438\u0444|\u0438\u043A\u0430\u0446\u0438\u044F","\u043E\u0444\u043E\u0440\u043C\u043B|\u0435\u043D\u0438\u0435","\u0441\u0442\u0438\u043B|\u0435\u0432\u044B\u0435 \u043F\u0440\u0430\u0432\u043A\u0438","\u043E\u0440\u0444\u043E\u0433\u0440|\u0430\u0444\u0438\u044F","\u043F\u0443\u043D\u043A\u0442|\u0443\u0430\u0446\u0438\u044F","\u043A\u0430\u0442|\u0435\u0433\u043E\u0440\u0438\u0437\u0430\u0446\u0438\u044F","\u043A \u0443\u0434\u0430\u043B|\u0435\u043D\u0438\u044E","\u0438\u043B\u043B|\u044E\u0441\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435","\u0438\u0441\u0442\u043E\u0447|\u043D\u0438\u043A\u0438","\u0437\u0430\u043F\u0440|\u043E\u0441 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430","\u0434\u043E\u043F|\u043E\u043B\u043D\u0435\u043D\u0438\u0435","\u0443\u0442\u043E\u0447\u043D|\u0435\u043D\u0438\u0435","\u0438\u0441\u043F\u0440|\u0430\u0432\u043B\u0435\u043D\u0438\u0435","\u043E\u0431\u043D\u043E\u0432|\u043B\u0435\u043D\u0438\u0435"]:["\u0432\u0438\u043A\u0438\u0444|\u0438\u043A\u0430\u0446\u0438\u044F","\u043E\u0444\u043E\u0440\u043C\u043B|\u0435\u043D\u0438\u0435","\u0441\u0442\u0438\u043B|\u0435\u0432\u044B\u0435 \u043F\u0440\u0430\u0432\u043A\u0438","\u043E\u0440\u0444\u043E\u0433\u0440|\u0430\u0444\u0438\u044F","\u043F\u0443\u043D\u043A\u0442|\u0443\u0430\u0446\u0438\u044F","\u0432\u043E\u043F\u0440\u043E\u0441","\u043E\u0442\u0432\u0435\u0442","\u043A\u043E\u043C\u043C|\u0435\u043D\u0442\u0430\u0440\u0438\u0439","\u043A\u0430\u0442|\u0435\u0433\u043E\u0440\u0438\u0437\u0430\u0446\u0438\u044F","\u043A \u0443\u0434\u0430\u043B|\u0435\u043D\u0438\u044E","\u0438\u043B\u043B|\u044E\u0441\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435","\u0438\u0441\u0442\u043E\u0447|\u043D\u0438\u043A\u0438","\u0437\u0430\u043F\u0440|\u043E\u0441 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430","\u0434\u043E\u043F|\u043E\u043B\u043D\u0435\u043D\u0438\u0435","\u0443\u0442\u043E\u0447\u043D|\u0435\u043D\u0438\u0435","\u0438\u0441\u043F\u0440|\u0430\u0432\u043B\u0435\u043D\u0438\u0435","\u043E\u0431\u043D\u043E\u0432|\u043B\u0435\u043D\u0438\u0435","\u0437\u0430\u043A\u0440|\u044B\u0442\u043E","\u0438\u0442\u043E\u0433"];summaryButtons.hideDefaultButtons||$.each(h,function(a,b){addSummaryButton(b.replace(/\|.*/,""),b.replace(/\|/,""),"default")}),mw.hook("summaryButtons").fire()}window.ve&&ve.init&&ve.init.target&&ve.init.target.active||$(".ve-loading").length?mw.hook("ve.saveDialog.stateChanged").add(function(){!mw.config.get("wgArticleId")||$(".summaryButtons").length||initSummaryButtons(ve.init.target.getSurface().getMode())}):-1!==["edit","submit"].indexOf(mw.config.get("wgAction"))&&$(function(){var a=document.getElementById("editform");mw.config.get("wgArticleId")&&a&&"new"!==$(a.wpSection).val()&&initSummaryButtons("classic")});